> return Sqr((sin(EPoint[X]) + sin(EPoint[Y] + sin(EPoint[Z])))/3.0);
You probably mean Sqr((sin(EPoint[X])+sin(EPoint[Y])+sin(EPoint[Z]))/3);
Temporary variables are do not affect the performance mostly though. The
has to use several registers anyways. But to show the vector nature of this
calculation it should be written as:
DBL value=0;
for(int i=0; i<3; i++) value+=sin(EPoint[i]);
return Sqr(value/3.0);
Of course this assumes that X,Y,Z are 0-2 index.
--
http://objects.povworld.org - the POV-Ray Objects Collection
Post a reply to this message
|